Cloud-based services are often provided via applications that are executed via a web browser. To develop such an application, a programmer may develop an application that is to be executed by a web browser of a client and that accesses services of a server of a cloud data center. The application (or client code) typically provides a user interface through which a user can access features of the application. For example, if the application is a word processor, then the application displays content of a document being edited, a menu bar for accessing features of the word processor (e.g., open document and insert footnote), and so on. The document that is being edited is stored on the server. Thus, when the user requests to open the document, the application sends an open request to the server and receives a copy of at least a portion of the document. The application displays content of the document. When a user makes a change to the document, the application may update the displayed content and send a message to the server. The server then changes the document. The communications between the client and the server typically are based on Representational State Transfer (“REST”) or RESTful model such as Hypertext Transport Protocol (“HTTP”) request messages (e.g., a GET method) and response messages.
Such applications are typically written in JavaScript because most browsers support the execution of JavaScript applications. The server code, in contrast, is typically written in programming languages other than JavaScript, such as C# or C++, for efficiency reasons because JavaScript is an interpreted language and C# and C++ are compiled in executables. JavaScript and C# and C++ are object-oriented programming languages. An object-oriented programming language supports a programming model in which the program specifies classes that define the types of objects that can be instantiated. A class defines the data members and methods (also referred to as member functions) for the objects of that class. Each method has a signature that specifies the name of the method, the types of input parameters to be passed to the method, and the types of output parameters to be returned by the method. For example, a document class may be defined to include methods for opening a document, modifying the document, and saving the document. During execution of an application, after an object of a certain class is instantiated, the application can invoke a method of the object by specifying a reference to the object, an indication of the method to invoke, and the input parameters (if any) to be passed to the method. When the method completes, the method returns the output parameters (if any).
Such applications have historically accessed services of a server using a web service interface that is defined by a Web Services Description Language (“WSDL”) or using some other type of a remote procedure call (“RPC”) mechanism. Unfortunately, there is little support for object-oriented RPCs, also referred to as remote method invocations (“RMIs”), from such applications to servers. As a result, such applications often do not use an object-oriented approach when accessing objects hosted by a server.